<template>
  <div class="container-content">
    <el-row>
      <el-col :span="24">
        <h3 class="panel-title">编辑员工</h3>
      </el-col>
    </el-row>
    <el-form
      ref="formObjectRef"
      :model="formObject"
      label-width="80px"
      label-position="left"
      :rules="formObjectRules"
      status-icon
    >
      <el-card class="top-form" shadow="never">
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="组织名称">
              <el-select placeholder="请选择" style="width: 100%">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="部门名称">
              <el-select
                v-model="formObject.dept.deptName"
                placeholder="请选择"
                style="width: 100%"
              >
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="岗位名称">
              <el-select
                v-model="value"
                placeholder="请选择"
                style="width: 100%"
              >
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="姓名">
              <el-input v-model="formObject.nickName"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="状态">
              <!-- <el-input v-model="formObject.staffStatus"></el-input> -->
              <el-select
                v-model="formObject.staffStatus"
                placeholder="请选择"
                style="width: 100%"
              >
                <el-option
                  v-for="item in staffStatusOptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="工号">
              <el-input v-model="formObject.jodNumber"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="用户名">
              <el-input v-model="formObject.userName"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="密码">
              <el-input
                v-model="formObject.password"
                type="password"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="英文名">
              <el-input></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="性别">
              <el-radio v-model="formObject.sex" label="1" border>女</el-radio>
              <el-radio v-model="formObject.sex" label="2" border>男</el-radio>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="民族">
              <el-input v-model="formObject.nation"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="身份证号码" label-width="110px">
              <el-input v-model="formObject.idCard"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="出生日期">
              <el-date-picker
                v-model="formObject.birthdayTime"
                type="date"
                placeholder="选择日期"
                style="width: 100%"
              >
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="年龄">
              <el-input></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="最高学历">
              <el-input></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="专业">
              <el-input
                v-model="formObject.professionalQualification"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="毕业时间">
              <el-date-picker
                type="date"
                placeholder="选择日期"
                style="width: 100%"
              >
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="籍贯">
              <el-input></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="婚姻状况">
              <el-radio v-model="formObject.marriage" :label="1" border
                >是</el-radio
              >
              <el-radio v-model="formObject.marriage" :label="2" border
                >否</el-radio
              >
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="工作年限">
              <el-input></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="联系电话">
              <el-input v-model="formObject.phonenumber"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="有无子女">
              <el-radio v-model="formObject.hasChildren" :label="1" border
                >有</el-radio
              >
              <el-radio v-model="formObject.hasChildren" :label="2" border
                >无</el-radio
              >
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="政治面貌">
              <el-input v-model="formObject.political"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="银行卡号">
              <el-input v-model="formObject.bankNum"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="开户银行">
              <el-input v-model="formObject.bank"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="开户名称">
              <el-input v-model="formObject.bankName"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="邮箱地址">
              <el-input v-model="formObject.email"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="QQ号码">
              <el-input v-model="formObject.qq"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="微信号码">
              <el-input v-model="formObject.weCharNum"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="紧急联系人" label-width="110px">
              <el-input v-model="formObject.emergencyContact"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="紧急人关系" label-width="110px">
              <el-input v-model="formObject.emergencyRelation"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="紧急人电话" label-width="110px">
              <el-input v-model="formObject.emergencyTel"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="入职日期">
              <el-date-picker
                v-model="formObject.empTime"
                type="date"
                placeholder="选择日期"
                style="width: 100%"
              >
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="招聘来源">
              <el-input v-model="formObject.recruitmentSources"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="推荐人">
              <el-input v-model="formObject.recommendedBy"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="工作地点">
              <el-input v-model="formObject.workAddress"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="职称">
              <el-input v-model="formObject.professionalTitle"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="专业资格">
              <el-input
                v-model="formObject.professionalQualification"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="职位">
              <el-input></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="入职导师">
              <el-input></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="转正日期">
              <el-date-picker
                v-model="formObject.formalTime"
                type="date"
                placeholder="选择日期"
                style="width: 100%"
              >
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="20">
            <el-form-item label="现通讯地址" label-width="110px">
              <el-input v-model="formObject.mailingAddress"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="邮编">
              <el-input v-model="formObject.postalCode"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="20">
            <el-form-item label="身份证地址" label-width="110px">
              <el-input v-model="formObject.idAddress"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="邮编">
              <el-input v-model="formObject.postalCode"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="离职日期">
              <el-date-picker
                v-model="formObject.resTime"
                type="date"
                placeholder="选择日期"
                style="width: 100%"
              >
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="离职性质">
              <el-input></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="离职原因">
              <el-input v-model="formObject.resReason"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="24">
            <el-form-item label="照片">
              <el-upload
                class="upload-demo"
                ref="upload"
                action="https://jsonplaceholder.typicode.com/posts/"
                :on-preview="handlePreview"
                :on-remove="handleRemove"
                :file-list="fileList"
                :auto-upload="false"
              >
                <el-button slot="trigger" size="small" type="primary"
                  ><i class="el-icon-plus"></i>添加</el-button
                >
              </el-upload>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="24">
            <el-form-item label="证件">
              <el-upload
                class="upload-demo"
                ref="upload"
                action="https://jsonplaceholder.typicode.com/posts/"
                :on-preview="handlePreview"
                :on-remove="handleRemove"
                :file-list="fileList"
                :auto-upload="false"
              >
                <el-button slot="trigger" size="small" type="primary"
                  ><i class="el-icon-plus"></i>添加</el-button
                >
              </el-upload>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <div class="desc-title">家庭成员及主要社会关系</div>
      <el-table
        :data="formObject.userMajorSocialRelationEntities"
        style="width: 100%"
        highlight-current-row
        border
      >
        <template #empty
          ><el-button plain type="primary" round @click="addNewRow('social')"
            >添加新行</el-button
          ></template
        >
        <el-table-column label="操作" width="110">
          <template slot-scope="scope">
            <el-button
              plain
              icon="el-icon-plus"
              @click="handleDataAdd_social(scope.$index, scope.row)"
            ></el-button>
            <el-button
              plain
              icon="el-icon-minus"
              @click="handleDataDelete_social(scope.$index, scope.row)"
            ></el-button>
          </template>
        </el-table-column>
        <el-table-column label="序号" type="index"></el-table-column>
        <el-table-column label="姓名" width="150" prop="userName">
          <template slot-scope="scope">
            <el-form-item prop="userName" label-width="0px" style="margin: 0">
              <el-input v-model="scope.row.userName"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column label="关系" prop="relation">
          <template slot-scope="scope">
            <el-input v-model="scope.row.relation"></el-input>
          </template>
        </el-table-column>

        <el-table-column label="出生日期" prop="birthDate">
          <template slot-scope="scope">
            <el-date-picker
              v-model="scope.row.birthDate"
              type="date"
              placeholder="选择日期"
              style="width: 100%"
            >
            </el-date-picker>
          </template>
        </el-table-column>
        <el-table-column label="职务" prop="position">
          <template slot-scope="scope">
            <el-input
              v-model="scope.row.position"
              @change="positionChange(scope.row.position, scope.$index)"
            ></el-input>
          </template>
        </el-table-column>
        <el-table-column label="电话" prop="tel">
          <template slot-scope="scope">
            <el-input v-model="scope.row.tel" clearable></el-input>
          </template>
        </el-table-column>
        <el-table-column label="通讯地址" prop="address">
          <template slot-scope="scope">
            <el-input v-model="scope.row.address" clearable></el-input>
          </template>
        </el-table-column>
      </el-table>
      <div class="desc-title">教育经历</div>
      <el-table
        :data="formObject.userEducationalEntities"
        style="width: 100%"
        highlight-current-row
        border
      >
        <template #empty
          ><el-button plain type="primary" round @click="addNewRow('education')"
            >添加新行</el-button
          ></template
        >
        <el-table-column label="操作" width="110">
          <template slot-scope="scope">
            <el-button
              plain
              icon="el-icon-plus"
              @click="handleDataAdd_education(scope.$index, scope.row)"
            ></el-button>
            <el-button
              plain
              icon="el-icon-minus"
              @click="handleDataDelete_education(scope.$index, scope.row)"
            ></el-button>
          </template>
        </el-table-column>
        <el-table-column label="序号" type="index"> </el-table-column>
        <el-table-column label="学习年限" width="150">
          <template slot-scope="scope">
            <el-form-item prop="" label-width="0px" style="margin: 0">
              <el-input></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column label="学历" prop="educational">
          <template slot-scope="scope">
            <el-input v-model="scope.row.educational"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="学历性质" prop="educationalAttr">
          <template slot-scope="scope">
            <el-input
              v-model="scope.row.educationalAttr"
              @change="positionChange(scope.row.position, scope.$index)"
            ></el-input>
          </template>
        </el-table-column>
        <el-table-column label="毕业院校" prop="graduationInstitution">
          <template slot-scope="scope">
            <el-input v-model="scope.row.graduationInstitution"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="专业" prop="major">
          <template slot-scope="scope">
            <el-input v-model="scope.row.major" clearable></el-input>
          </template>
        </el-table-column>
        <el-table-column label="证书" prop="certificate">
          <template slot-scope="scope">
            <el-input v-model="scope.row.certificate" clearable></el-input>
          </template>
        </el-table-column>
      </el-table>
      <div class="desc-title">工作经历</div>
      <el-table
        :data="formObject.userWorkExperienceEntities"
        style="width: 100%"
        highlight-current-row
        border
      >
        <template #empty
          ><el-button plain type="primary" round @click="addNewRow('work')"
            >添加新行</el-button
          ></template
        >
        <el-table-column label="操作" width="110">
          <template slot-scope="scope">
            <el-button
              plain
              icon="el-icon-plus"
              @click="handleDataAdd_work(scope.$index, scope.row)"
            ></el-button>
            <el-button
              plain
              icon="el-icon-minus"
              @click="handleDataDelete_work(scope.$index, scope.row)"
            ></el-button>
          </template>
        </el-table-column>
        <el-table-column label="序号" prop="index" width="50"></el-table-column>
        <el-table-column label="工作年限">
          <template slot-scope="scope">
            <el-input></el-input>
          </template>
        </el-table-column>
        <el-table-column label="公司名称" width="150" prop="companyName">
          <template slot-scope="scope">
            <el-form-item
              prop="companyName"
              label-width="0px"
              style="margin: 0"
            >
              <el-input v-model="scope.row.companyName"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column label="部门" prop="department">
          <template slot-scope="scope">
            <el-input v-model="scope.row.department"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="职位" prop="position">
          <template slot-scope="scope">
            <el-input
              v-model="scope.row.position"
              @change="positionChange(scope.row.position, scope.$index)"
            ></el-input>
          </template>
        </el-table-column>
        <el-table-column label="主要成绩" prop="achievements">
          <template slot-scope="scope">
            <el-input v-model="scope.row.achievements"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="离职原因" prop="resReason">
          <template slot-scope="scope">
            <el-input v-model="scope.row.resReason" clearable></el-input>
          </template>
        </el-table-column>
      </el-table>
      <el-form-item label-width="0px" style="margin-top: 20px">
        <el-button
          type="primary"
          size="medium"
          @click="formSubmit('basicFormRef')"
          >保存</el-button
        >
        <el-button size="medium" @click="formRest('basicFormRef')"
          >取消</el-button
        >
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
import { updateUser, getUser } from "@/api/system/user";
export default {
  data() {
    return {
      activeName: "basic",
      formObject: {
        dept: {
          deptName: "", //部门名称
        },
        password: "", //密码
        userName: "", //用户名
        staffStatus: "", //状态
        formObject: "", //工号
        sex: "", //性别
        nation: "", //民族
        idCard: "", //身份证号码
        nickName: "", //姓名
        birthdayTime: "", //出生日期
        marriage: "", //婚姻状况
        phonenumber: "", //联系电话
        hasChildren: "", //是否有子女
        political: "", //政治面貌
        bankNum: "", //银行卡号
        bank: "", //开户银行
        bankName: "", //开户名称
        email: "", //邮箱
        qq: "", //QQ号码
        weCharNum: "", //微信号码
        emergencyContact: "", //紧急联系人
        emergencyRelation: "", //紧急联系人关系
        emergencyTel: "", //紧急联系人电话
        empTime: "", //入职日期
        recruitmentSources: "", //招聘来源
        recommendedBy: "", //推荐人
        workAddress: "", //工作地点
        professionalTitle: "", //职称
        professionalQualification: "", //专业资格
        formalTime: "", //转正日期
        mailingAddress: "", //现通讯地址
        postalCode: "", //邮编
        idAddress: "", //身份证地址
        resTime: "", //离职日期
        resReason: "", //离职原因
        userId: "", //userId
        userMajorSocialRelationEntities: [],
        userWorkExperienceEntities: [],
        userEducationalEntities: [],
      },
      provinces: [
        {
          value: "bejing",
          label: "北京",
        },
        {
          value: "tianjin",
          label: "天津",
        },
      ],
      cities: [
        {
          value: "bejing",
          label: "北京",
        },
        {
          value: "tianjin",
          label: "天津",
        },
      ],
      counties: [
        {
          value: "bejing",
          label: "北京",
        },
        {
          value: "tianjin",
          label: "天津",
        },
      ],
      formObjectRules: {
        // customerName: [
        //   { required: true, message: "客户名称不能为空！", trigger: "blur" },
        // ],
        // name: [
        //   { required: true, message: "联系人姓名不能为空！", trigger: "blur" },
        // ],
      },
      staffStatusOptions: [
        {
          value: 1,
          label: "实习",
        },
        {
          value: 2,
          label: "试用期",
        },
        {
          value: 3,
          label: "已转正",
        },
        {
          value: 4,
          label: "试用不合格",
        },
        {
          value: 5,
          label: "已辞退",
        },
        {
          value: 6,
          label: "自愿离职",
        },
        {
          value: 7,
          label: "黑名单",
        },
      ],
    };
  },
  methods: {
    // 页签切换事件
    handleClick(tab, event) {
      console.log(tab, event);
    },
    // 附件上传
    handleFileChange() {
      console.log("文件上传");
    },

    // 基础表单提交
    formSubmit(formObjectRef) {
      // this.$refs[formObjectRef].validate((valid) => {
      //   if (valid) {
      //     // alert("submit!");
      //     console.log("表单提交", his.formObject);
      // let JSONObject = JSON.parse(JSON.stringify(this.formObject));
      // console.log("JSONObject", JSONObject);
      //处理空数组
      // if(this.formObject.addresses.length === 1){

      // }
      updateUser(this.formObject).then((res) => {
        if (res.code === 200) {
          this.$message({
            message: "编辑员工成功！",
            type: "success",
          });
          this.$router.push({ path: "/Base/User" });
        }
      });

      //
      //   } else {
      //     this.$message({
      //       message: "表单信息不完整，请修改后重新提交！",
      //       type: "error",
      //     });
      //     return false;
      //   }
      // });
      console.log("提交", this.formObject);
    },
    // 基础表单取消
    formRest(basicFormRef) {
      this.$refs[basicFormRef].resetFields();
    },
    // 家庭成语及主要社会关系表单 添加行
    handleDataAdd_social() {
      if (this.formObject.userMajorSocialRelationEntities == undefined) {
        this.formObject.userMajorSocialRelationEntities = [];
      }
      let obj = {};
      obj.userName = "";
      obj.relation = "";
      obj.birthDate = "";
      obj.position = "";
      obj.tel = "";
      obj.address = "";

      this.formObject.userMajorSocialRelationEntities.push(obj);
    },
    // 家庭成语及主要社会关系表单 删除行
    handleDataDelete_social(index, row) {
      this.$confirm("请确认是否要删除此行？", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.$message({
            type: "success",
            message: "删除成功!",
          });
          this.formObject.userMajorSocialRelationEntities.splice(index, 1);
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    //教育经历 添加行
    handleDataAdd_education() {
      if (this.formObject.userEducationalEntities == undefined) {
        this.formObject.userEducationalEntities = [];
      }
      let obj = {};
      obj.educational = "";
      obj.educationalAttr = "";
      obj.graduationInstitution = "";
      obj.major = "";
      obj.certificate = "";

      this.formObject.userEducationalEntities.push(obj);
    },
    //银行信息表单 删除行
    handleDataDelete_education(index, row) {
      this.$confirm("请确认是否要删除此行?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.formObject.userEducationalEntities.splice(index, 1);
          this.$message({
            type: "success",
            message: "删除成功!",
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    //工作经历 添加行
    handleDataAdd_work() {
      if (this.formObject.userWorkExperienceEntities == undefined) {
        this.formObject.userWorkExperienceEntities = [];
      }
      let obj = {};
      obj.companyName = "";
      obj.department = "";
      obj.position = "";
      obj.achievements = "";
      obj.resReason = "";

      this.formObject.userWorkExperienceEntities.push(obj);
    },
    //工作经历 删除行
    handleDataDelete_work(index, row) {
      this.$confirm("请确认是否要删除此行?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.formObject.userWorkExperienceEntities.splice(index, 1);
          this.$message({
            type: "success",
            message: "删除成功!",
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    //添加新行
    addNewRow(type) {
      if (type === "social") {
        this.handleDataAdd_social();
      } else if (type === "education") {
        this.handleDataAdd_education();
      } else {
        this.handleDataAdd_work();
      }
    },
    //获取详细信息
    getData(id) {
      getUser(id).then((res) => {
        console.log("res", res);
        if (res.code == 200) {
          let data = res.data;
          // 用户名
          this.formObject.userName = data.userName;
          // 姓名
          this.formObject.nickName = data.nickName;
          // 电话号码
          this.formObject.phonenumber = data.phonenumber;
          // 邮箱
          this.formObject.email = data.email;
          // userId
          this.formObject.userId = data.userId;

          // // 家庭关系成员
          if (data.userMajorSocialRelationEntities.length) {
            data.userMajorSocialRelationEntities.forEach((item) => {
              this.formObject.userMajorSocialRelationEntities.push(item);
            });
          }
          // 教育经历
          if (data.userEducationalEntities.length) {
            data.userEducationalEntities.forEach((item) => {
              this.formObject.userEducationalEntities.push(item);
            });
          }
          // 工作经历
          if (data.userWorkExperienceEntities.length) {
            data.userWorkExperienceEntities.forEach((item) => {
              this.formObject.userWorkExperienceEntities.push(item);
            });
          }
        }
      });
    },
  },
  created() {
    this.getData(this.$route.query.id);
  },
};
</script>
<style lang="scss" scoped>
// .add {
//   padding: 15px;
// }
.panel-title {
  font-size: 18px;
  color: #37474f;
  font-weight: 500;
  text-shadow: rgba(0, 0, 0, 0.15) 0 0 1px;
  margin-bottom: 20px;
}
::v-deep .el-form-item__content {
  margin-left: 0;
}
.main-responsible {
  font-size: 14px;
  font-weight: 550;
  color: #263238;
  position: relative;
  text-indent: 15px;
}
.top-form {
  // border: 1px solid #ccc;
  // padding: 20px;
  margin-bottom: 20px;
}
</style>
